import imp


import cv2 as cv
import numpy as np

width = 10000
height = 10000
img = np.zeros((width,height,3),np.uint8)

#外参
outside = np.array([[1,0,0,0],[0,1,0,0],[0,0,1,1]])
#内参
inside = np.array([[318.7855,0,640],[0,154.5454,512],[0,0,1]])
point_one = np.array([[250],[250],[0],[1]])
point_two = np.array([[-250],[-250],[0],[1]])
trans = np.matmul(inside,outside)
pic_point_one = np.matmul(trans,point_one)
pic_point_two = np.matmul(trans,point_two)
x1,y1,z1 = pic_point_one
x2,y2,z2 = pic_point_two


cv.rectangle(img,(int(x1/100+500),int(y1/100+500)),(int(x2/100+500),int(y2/100+500)),(255,0,0),-1)
print(pic_point_one)
print(pic_point_two)

cv.imshow('Image',img)
cv.waitKey(0)
cv.destroyAllWindow()
